﻿using System;
using System.IO;
using System.Text;
using YJKGridTopologyCal.Utilities;

namespace YJKGridTopologyCal.IO
{
	public class BEBinaryWriter : BinaryWriter
	{
		public BEBinaryWriter()
		{
		}

		public BEBinaryWriter(Stream output) : base(output)
		{
		}

		public BEBinaryWriter(Stream output, Encoding encoding) : base(output, encoding)
		{
		}

		public override void Write(short value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		[CLSCompliant(false)]
		public override void Write(ushort value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		public override void Write(int value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		[CLSCompliant(false)]
		public override void Write(uint value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		public override void Write(long value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		[CLSCompliant(false)]
		public override void Write(ulong value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		public override void Write(float value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		public override void Write(double value)
		{
			base.Write(BitTweaks.ReverseByteOrder(value));
		}

		[Obsolete("Not implemented")]
		public override void Write(string value)
		{
			throw new NotImplementedException();
		}

		[Obsolete("Not implemented")]
		public override void Write(decimal value)
		{
			throw new NotImplementedException();
		}
	}
}
